package com.ynwt.repository;

import com.ynwt.domain.Event;
import com.ynwt.enums.EventStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by huangying on 2017/5/4.
 */
@Repository
public interface EventDao extends PagingAndSortingRepository<Event, String> {

    List<Event> findByKeyOrKeyOrKeyOrderByStartTime(String keyOne, String keyTwo, String keyThree);

    List<Event> findByKeyStartingWithOrderByStartTime(String keyStartStr);

    Page<Event> findByKeyStartingWithOrderByEndTimeDesc(String keyStartStr, Pageable pageable);

    List<Event> findByKeyStartingWith(String keyStartStr);

    List<Event> findByKeyStartingWithAndStatusOrderByContentDesc(String keyStartStr, EventStatus status);
}
